#ifndef TCPSERVER_H
#define TCPSERVER_H
#include "EventLoop.h"
#include "ThreadPool.h"

#include <arpa/inet.h>
#include <stdlib.h>
#include <stdio.h>

class TcpServer
{
public:
    TcpServer(unsigned short port, int threadNum);

    void setListen();

    void run();

    static int acceptConnection(void* arg);

private:
    int m_threadNum;
    EventLoop* m_mainLoop;
    ThreadPool* m_threadPool;
    int m_lfd;
    unsigned short m_port;
};

#endif // TCPSERVER_H
